<%--
  Created by IntelliJ IDEA.
  User: Yy
  Date: 2022/5/24
  Time: 9:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/ajaxForm.js"></script>
    <script>
        layui.use(['form', 'laydate', 'layer'], function () {
            var form = layui.form, laydate = layui.laydate, layer = layui.layer;
            //监听表单提交
            form.on('submit(formbtn)', function () {
                $("#formsbt").ajaxSubmit({
                    type: "post",
                    url: '${pageContext.request.contextPath}/stu/addctype',
                    success: function (data) {//添加成功的回调函数
                        var index = parent.layer.getFrameIndex(window.name);//获取Frame索引
                        parent.layer.close(index);//关闭当前frame
                        parent.layui.table.reload("titleStu");//可以对父窗口进行刷新
                    }
                });
            });
        });
    </script>
</head>
<body>
    <form class="layui-form" id="formsbt">
        <%--    班级编号--%>
        <div class="layui-form-item">
            <label class="layui-form-label">类别名称</label>
            <div class="layui-input-inline">
                <input type="text" name="courseTypeName" id="courseTypeName" placeholder="类别名称"
                       autocomplete="off" class="layui-input" lay-verify="required">
            </div>
            <div class="layui-form-mid layui-word-aux">必填项</div>
        </div>
        <%--    班级编号--%>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline">
                <input type="text" name="remark" id="remark" placeholder="备注"
                       autocomplete="off" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button id="formbtn" type="button" lay-submit lay-filter="formbtn" class="layui-btn layui-btn-normal">
                保存
            </button>
            <button id="reset" type="reset" class="layui-btn layui-btn-normal">
                重置
            </button>
        </div>
    </form>
</body>
</html>
